import codecs,os
fl=os.listdir('media/cn_txt/')
length=len(fl)

article_title_dict={}
articlelist=codecs.open('media/articlelist.txt','rb','utf16').readlines()
for title in articlelist:
    article_title_dict[title[:3]]=title[9:-2]

print '<table style="width: 100%">'
for i in xrange(0,length,3):
    j=0
    print '<tr>'
    while j<3:
        print '<td>%s</td>'%('<a href="'+fl[i+j][:3]+'">'+article_title_dict[fl[i+j][:3]]+'</a><br/>')
        j+=1
    print '</tr>'
print '</table>'